package com.yuyou.fn.portal.service;

import com.github.wens.framework.service.ISuperService;
import com.github.wens.mybatisplus.plugins.Page;
import com.yuyou.fn.portal.entity.OuterOrder;
import com.yuyou.fn.portal.vo.DiscountDetailVo;
import com.yuyou.fn.portal.vo.OuterOrderDetail;
import com.yuyou.fn.portal.vo.StudentCourseClass;

import java.math.BigDecimal;
import java.util.Date;
import java.util.List;
import java.util.concurrent.ExecutionException;

/**
 *
 * OuterOrder 表数据服务层接口
 *
 */
public interface IOuterOrderService extends ISuperService<OuterOrder,Long> {


    Page<OuterOrderDetail> findOuterOrder(Long userId, int pageNo, int pageSize);

    Page<OuterOrderDetail> findOuterOrder(Long userId, int pageNo, int pageSize, List<Integer> chargingStatusList);

    Long countOuterOrder(Long userId, List<Integer> chargingStatusList);

    List<OuterOrder> findOuterOrder(Integer chargingStatus, Date date);

    List<StudentCourseClass> findStudentCourseClass(Long userId, Long studentId, int pageNo, int pageSize, Integer regStatus);

    OuterOrderDetail findOuterOrder(Long outerOrderId);

    Long createOuterOrder(Long classId, Long studentId , Long userId, Long counselorId);

    Long createOuterOrder(Long classId, Long studentId , Long userId, Long counselorId , String channel) ;

    Long createOuterOrderFromShoppingCart(List<Long> outerShoppingCartIds, Long studentId , Long userId);

    Long createOuterOrderFromShoppingCart(List<Long> outerShoppingCartIds , Long studentId , Long userId , String channel  );

    List<OuterOrder> findByLessCreateTimeAndStatus(Date date, Integer chargingStatus);
    /*撤销订单*/
    void cancelOuterOrder(Long outerOrderId,Integer chargingStatus);

    List<DiscountDetailVo> calDiscountFromShoppingCart(List<Long> outerShoppingCartIds , Long studentId  );


    OuterOrder findOneRecent(Long userId);

    void onlinePaySuccess(Long payOrderId, Long outerOrderId, BigDecimal amount, String payInfoExt);

    void confirmPayForOnlyBalance(Long payOrderId );

    void addDiscount(Long outerOrderId, String discountCode, Long discountId);

    String saveLastCampusGeoLocation(long userId);

    /**
    *@Description: 刷新订单使用的余额
    *@Param:
    *@return: 
    *@Author: lzh
    *@date: 
    */
    void   refreshOuterOrderBalancePays(long outerOrderId);

}